public class Main {
    public static void main(String[] args) {
        // 创建文件
        File file1 = new File(100);
        File file2 = new File(200);

        // 创建文件夹并添加文件
        Folder folder1 = new Folder();
        Folder folder2 = new Folder();
        folder1.add(file1);
        folder2.add(file2);
        folder2.add(folder1);

        // 统一调用getSize()
        System.out.println("文件大小: " + file1.getSize());  // 输出 100
        System.out.println("文件夹大小: " + folder2.getSize()); // 输出 300
    }
}
